﻿using System;
using System.Collections.Generic;
using DISP.Wrappers.Ninject;

namespace DISP.Core
{
    internal class IoCContainerProvider
    {
        private readonly IIoCContainerWrapper _ioCContainerWrapper;

        public void BindService(Service service)
        {
            _ioCContainerWrapper.BindService(service);
        }

        public Object GetService(Type service)
        {
            return _ioCContainerWrapper.GetService(service);
        }

        public IoCContainerProvider(IoCContainerTypeEnum containerTypeEnum, IEnumerable<Service> services)
        {
            switch (containerTypeEnum)
            {
                case IoCContainerTypeEnum.CastleWindsor:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.StructureMap:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.SpringDotNet:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.Autofac:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.Unity:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.PuzzleNFactory:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.Ninject:
                    this._ioCContainerWrapper = new NinjectWrapper(services);
                    break;
                case IoCContainerTypeEnum.S2ContainerDotNet:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.PicoContainerDotNet:
                    throw new NotImplementedException();
                    break;
                case IoCContainerTypeEnum.LinFu:
                    throw new NotImplementedException();
                    break;
                default:
                    throw new NotImplementedException();
            }
        }
    }
}